<?php

require_once 'init.php';

$page = cf\api\page\get(cf\param::get('id'), 'main_menu');
$smarty->assign('page',$page);
$smarty->assign('pageText',cf\api\page\getText($page['id']));
$pageId = $page['id'];

$smarty->assign('childPages', cf\api\page\getTree($page['id'],true,0,$page['branch'][1]['path']));

$pageImage = $page['icon'];
for ($p=$page['parent']; !$pageImage && is_array($p); $p=$p['parent']) {
	$pageImage = $p['icon'];
}
$smarty->assign('pageImage',$pageImage);

show(
	'page', 
	$page['name'] ? $page['name'] : $page['menu_name'], 
	getCrumbs($page['branch']), 
	$page['title'], 
	$page['keywords'], 
	$page['descr']
);

?>